var e = getApp();

Page({
    data: {
        language: "",
        dainfo: "",
        spec: !1
    },
    onLoad: function(e) {
        this.setData({
            id: e.level_id
        }), "goods_spec" == e.spec && this.setData({
            spec: !0
        }), this.getData();
    },
    openSubmit: function() {
        this.data.spec ? wx.navigateTo({
            url: "/packageC/o2o/card/CardChooseMembership/CardChooseMembership?goods_id=" + this.data.dainfo + "&level_id=" + this.data.member_level.has_one_universal_level.member_level_id
        }) : wx.navigateTo({
            url: "/packageD/buy/myOrder_v2/myOrder_v2?tag=-2&optionsId=&total=1&goodsId=" + this.data.dainfo
        });
    },
    onReady: function() {
        var e = wx.getStorageSync("langIndex");
        this.setData({
            language: e.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    radiong: function(e) {
        console.log(e), this.setData({
            dainfo: Number(e.detail)
        });
    },
    getData: function() {
        var a = this, t = e.getNetAddresss("plugin.universal-card.api.home.getLevel"), o = {
            level_id: this.data.id
        };
        e._getNetWork({
            url: t,
            data: o,
            success: function(e) {
                var t = e.data;
                1 == t.result && a.setData({
                    member_goods: t.data.member_goods,
                    member_level: t.data.member_level,
                    dainfo: t.data.member_goods.length > 0 ? t.data.member_goods[0].id : ""
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    }
});